<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>

<body>
    <div id="app">
        <ol>
            <li v-for="(i,index) in list">
                {{i.name}} -第{{ index + 1 }}个打
            </li>
        </ol>
        </ul>

        <input placeholder="请输入关键字" v-model="txt">
        <ul>
            <li v-for="v in search()">
                {{v}}
            </li>
        </ul>
    </div>
    <script>
        let app = new Vue({
            el: "#app",
            data: {
                list: [

                    { name: "一个打" },
                    { name: "两个打" },
                    { name: "三个打" },
                    { name: "四个打" },
                ],
                txt: "",
                list2: [
                    '门前大桥下',
                    '游过一群鸭',
                    '快来快来数一数',
                    '二十六七八',

                ]
            },
            methods: {
                search: function () {
                    if (this.txt.length == 0) {
                        return this.list2;
                    }
                    return this.list2.filter(o => o.indexOf(this.txt) != -1);

                }


            },



        });

    </script>

</body>

<html>